<script setup lang="ts">
import { Ref, ref, onMounted } from 'vue'

import {version} from '../version.js'

const emit = defineEmits(["enter"]) ;

// let ip = ref("127.0.0.1")

// let serailScanning = ref(false)
// let allSerialPorts: Ref<any[]> = ref([])
// let serialPort = ref("")

onMounted(async ()=>{
    $(".info-w3lsitem .btn").on('click', function () {
        $(".main-agileinfo").toggleClass("real-part");
    })
    $(".container-form .btn").on('click', function () {
        $(".main-agileinfo").addClass("active");
    })

    // if(runtime.serial) {
    //     await scanSerial()
    // }

    // if(runtime.platform=="html5")
    //     connectWS()
})

</script>

<template>
<div class="bg" style="height: 100%;">
    <div class="main agileits-w3layouts">
        
        <div>
            <div class="row center" style="align-items: flex-end;">
                <div style="font-size: 40px; color: #fff; margin-right: 10px;">BeConsole</div>
                <div style="font-size: 10px;margin-bottom: 6px;">version {{version}}</div>
            </div>
            <div style="text-align: center; margin-top: 10px; font-size: 18px">BECOME 智能积木 APP</div>
        </div>

        <div class="main-agileinfo">
            <div class="wthree-box"></div>
            <div class="agileui-forms">
                <div class="container-info">
                    <div class="info-w3lsitem">
                        <div class="w3table">
                            <div class="w3table-cell">
                                <p>我是工程师</p>
                                <div class="btn"> 极客模式 </div>
                            </div>
                        </div>
                    </div>
                    <div class="info-w3lsitem">
                        <div class="w3table">
                            <div class="w3table-cell">
                                <p>我不熟悉电子技术</p>
                                <div class="btn"> 创意模式 </div>
                            </div>
                        </div>
                    </div>
                    <div class="clear"> </div>
                </div>


                <div class="container-form column">
                    
                    <div class="form-item column real-part">
                        <img src="/images/real-part.png">
                
                        <div class="grow column" style="font-size: 12px; padding: 30px;">
                            <h3 style="margin-top: 0px;">极客模式</h3>
                            <div>
                                面向极客、工程师、科研工作的APP界面环境，为用户提供更丰富的创造工具。
                            </div>
                            <div class="grow"></div>
                            <input type="submit" class="btn" value="开始创造" @click="emit('enter','hall')">
                        </div>
                    </div>


                    <div class="form-item sign-up column">

                        <img src="/images/virtual-part.png">

                        <div class="grow column" style="font-size: 12px; padding: 30px;">
                            <h3 style="margin-top: 0px;">创意模式</h3>
                            <div>
                                面向普通消费者的APP界面，该模式隐藏了技术细节，让用户更专注于创意和乐趣。
                            </div>
                            <div class="grow"></div>
                            <input type="submit" class="btn" value="开始体验" @click="emit('enter','gallery')">
                        </div>
                                

                    </div>
                </div>


            </div>
        </div>
    </div>
    <div class="copyw3-agile">
        <p> © 2020 https://become.cool</p>
    </div>
</div>
</template>

<style scoped>
/*--reset--*/
ol,ul{list-style:none;margin:0px;padding:0px;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}
table{border-collapse:collapse;border-spacing:0;}
/*--start editing from here--*/
a{text-decoration:none;}
.txt-rt{text-align:right;}/* text align right */
.txt-lt{text-align:left;}/* text align left */
.txt-center{text-align:center;}/* text align center */
.float-rt{float:right;}/* float right */
.float-lt{float:left;}/* float left */
.clear{clear:both;}/* clear float */
.pos-relative{position:relative;}/* Position Relative */
.pos-absolute{position:absolute;}/* Position Absolute */
.vertical-base{	vertical-align:baseline;}/* vertical align baseline */
.vertical-top{	vertical-align:top;}/* vertical align top */
nav.vertical ul li{	display:block;}/* vertical menu */
nav.horizontal ul li{	display: inline-block;}/* horizontal menu */
img{max-width:100%;}
/*--end reset--*/
.bg {
font-family:Verdana;
     
    background-attachment: fixed;
	background-color: #fa8072;
}
h1 {
    font-size: 2.5em;
    text-align: center;
    color: #fff;
    font-weight: bolder;
    letter-spacing: 4px;
}
/*-- main --*/
.main {
    padding: 3em 0 0;
}
.main-agileinfo{
    width: 40%;
    margin: 7em auto;
	background-color: rgba(0, 0, 0, 0.13);
	position: relative; 
	-moz-transition: all 0.5s;
	-o-transition: all 0.5s;
	-webkit-transition: all 0.5s;
	transition: all 0.5s;
}
.w3table-topimg {
    margin-top: -4em;
}
.w3table-topimg img { 
    width: 100%;
}
.w3table-cell form {
    padding: 1.5em;
}
.main-agileinfo input[type="radio"] {
    margin: 0;
    width: 12px;
    display: inline-block;
	vertical-align: middle;
}
.main-agileinfo .radio {
    display: inline-block;
    margin-bottom: 1em;
    float: left;
    width: 22%;
}
.main-agileinfo .radio:nth-child(2) {
    width: 34%;
}
.main-agileinfo label {
    font-size: .75em;
    color: #999;
    margin-right: .8em; 
}
.main-agileinfo h5.w3ls-ltext {
    font-size: .8em;
    color: #999;
    font-weight: 600;
    margin-bottom: 0.5em;
}
.sign-up p {
    font-size: .7em;
    color: #999;
    margin-bottom: 1em;
}
/*-- forms --*/  
.w3table {
	display:table;
	width: 100%;
	height: 100%;
} 
.w3table-cell {
	display: table-cell;
	vertical-align: middle;
	-moz-transition: all 0.5s;
	-o-transition: all 0.5s;
	-webkit-transition: all 0.5s;
	transition: all 0.5s; 
} 
.main-agileinfo .wthree-box {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
.main-agileinfo .wthree-box:before, .main-agileinfo .wthree-box:after {
    content: " ";
    position: absolute;
    left: 153px;
    top: 42px;
    background-color: rgba(189, 95, 84, 0.39);
    -webkit-transform: rotateX(52deg) rotateY(15deg) rotateZ(-38deg);
    -moz-transform: rotateX(52deg) rotateY(15deg) rotateZ(-38deg);
    -ms-transform: rotateX(52deg) rotateY(15deg) rotateZ(-38deg);
    -o-transform: rotateX(52deg) rotateY(15deg) rotateZ(-38deg);
    transform: rotateX(52deg) rotateY(15deg) rotateZ(-38deg);
    width: 300px;
    height: 265px;
    -moz-transition: all 0.5s;
    -o-transition: all 0.5s;
    -webkit-transition: all 0.5s;
    transition: all 0.5s;
}
.main-agileinfo .wthree-box:after {
    background-color: rgba(250, 128, 114, 0.48);
    top: 22px;
    left: 155px;
    width: 324px;
    height: 220px;
}
.main-agileinfo .agileui-forms {
	position: relative;
}
.main-agileinfo .btn {
    cursor: pointer;
    text-align: center;
    margin: 0 auto;
    width: 100%;
    color: #fff;
    background-color: #00BCD4;
    opacity: 1;
    -moz-transition: all 0.5s;
    -o-transition: all 0.5s;
    -webkit-transition: all 0.5s;
    transition: all 0.5s;
    border: none;
	text-transform: uppercase;
	font-size: 0.9em;
    border-radius: 0px;
}
.main-agileinfo .btn:hover {
	opacity: 0.7;
}
.main-agileinfo .btn, .main-agileinfo input, .main-agileinfo textarea  {
	padding: 8px 12px;
}
.main-agileinfo .info-w3lsitem .btn {
    width: 35%;
}
.main-agileinfo input,.main-agileinfo textarea {
    margin: 0 auto 15px;
    display: block;
    width: 89%;
    -moz-transition: all 0.3s;
    -o-transition: all 0.3s;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    color: #999;
    font-size: 0.8em;
    left: 1px;
    outline: none;
	
}
.main-agileinfo textarea {
    min-height: 3em;
}
.main-agileinfo .agileui-forms .container-info {
	text-align: left;
	font-size: 0;
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem {
	text-align: center;
	font-size: 16px;
	width: 300px;
	height: 320px;
	display: inline-block;
	vertical-align: top;
	color: #fff;
	opacity: 1;
	-moz-transition: all 0.3s;
	-o-transition: all 0.3s;
	-webkit-transition: all 0.3s;
	transition: all 0.3s;
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem p {
	font-size: 20px;
	margin: 20px;
}
.agileui-forms .container-info .info-w3lsitem .btn {
	background-color: transparent;
	border: 1px solid #fff;
}
.agileui-forms .container-info .info-w3lsitem .w3table-cell {
	padding-right: 35px;
}
.agileui-forms .container-info .info-w3lsitem:nth-child(2) .w3table-cell {
	padding-left: 35px;
	padding-right: 0;
}
.container-form {
	overflow: hidden;
	position: absolute;
	left: 40px;
	top: -30px;
	width: 305px;
	height: 380px;
	background-color: #fff;
	-webkit-box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
	-moz-box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
	-o-box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
	-ms-box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
	box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
	-moz-transition: all 0.5s;
	-o-transition: all 0.5s;
	-webkit-transition: all 0.5s;
	transition: all 0.5s;
} 
.form-item {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	opacity: 1;
	-moz-transition: all 0.5s;
	-o-transition: all 0.5s;
	-webkit-transition: all 0.5s;
	transition: all 0.5s;
}
.form-item.sign-up {
	position: absolute;
	left: -100%;
	opacity: 0;
}
.real-part .wthree-box:before {
	position: absolute;
	left: 180px;
	top: 62px;
	height: 265px;
}
.real-part .wthree-box:after {
	top: 22px;
	left: 192px;
	width: 324px;
	height: 220px;
}
.real-part .container-form {
	left: 280px;
}
.real-part .container-form .form-item.sign-up {
	left: 0;
	opacity: 1;
}
.real-part .container-form .form-item.real-part {
	left: -100%;
	opacity: 0;
} 
/*-- //forms --*/
/*-- //main --*/   
/*-- copyright --*/
.copyw3-agile {
    margin: 2em 0;
    text-align: center;
}
.copyw3-agile p {
    font-size: 0.9em;
    color: #fff;
    line-height: 1.8em;
    letter-spacing: 1px;
    font-weight: 400;
	padding:0 1em;
}
.copyw3-agile p a{
    color: #fff;
	-webkit-transition: 0.5s all;
	-moz-transition: 0.5s all;
	transition: 0.5s all; 
}
.copyw3-agile p a:hover{
    color: #000;	
}
/*-- //copyright --*/
/*-- responsive-design --*/
@media(max-width:1440px){
.main-agileinfo {
    width: 44%; 
}
}
@media(max-width:1366px){
.main-agileinfo {
    width: 47%;
}
}
@media(max-width:1280px){
.main-agileinfo {
    width: 50%;
}
}
@media(max-width:1080px){
.main-agileinfo {
    width: 60%;
	margin: 6em auto;
} 
} 
@media(max-width:991px){
.main-agileinfo {
    width: 65%; 
}
}
@media(max-width:800px){
h1 {
    font-size: 2.6em; 
}
.main-agileinfo {
    width: 80%;
	margin: 5em auto;
}
.w3table-topimg {
    margin-top: -2em;
}
}
@media(max-width:768px){
.main-agileinfo {
    width: 83%; 
}
}
@media(max-width:736px){
.main-agileinfo {
    width: 85%; 
}
.main {
    padding: 2em 0 0;
}
h1 {
    font-size: 2.2em;
    letter-spacing: 3px;
}
.real-part .container-form {
    left: 266px;
}
}
@media(max-width:667px){
.container-form { 
    left: 30px; 
}
.main-agileinfo {
    width: 93%;
}
}
@media(max-width:640px){ 
.main-agileinfo .agileui-forms .container-info .info-w3lsitem { 
    width: 285px; 
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem p {
    font-size: 17px;
    margin: 15px;
}
.container-form {
    left: 22px;
	width: 280px;
}
.real-part .container-form {
    left: 270px;
}
.w3table-cell form {
    padding: 1em;
}
.main-agileinfo label {
    font-size: .7em; 
}
.main-agileinfo input, .main-agileinfo textarea { 
    width: 88%; 
}
.w3table-topimg {
    margin-top: -1.9em;
}
}
@media(max-width:600px){
.main-agileinfo .agileui-forms .container-info .info-w3lsitem {
    width: 265px;
}
.real-part .container-form {
    left: 232px;
}  
.main-agileinfo .wthree-box:before, .main-agileinfo .wthree-box:after { 
    left: 102px; 
}
.main-agileinfo .wthree-box:before, .main-agileinfo .wthree-box:after { 
    top: 32px; 
}
.real-part .wthree-box:before { 
    top: 32px; 
}
.real-part .wthree-box:after {
    top: 8px; 
}
}
@media(max-width:568px){
.main-agileinfo .agileui-forms .container-info .info-w3lsitem {
    width: 253px;
}
.real-part .container-form {
    left: 213px;
}
}
@media(max-width:480px){
.main-agileinfo {
    width: 85%;
	margin: 2em auto 4em;
}
.real-part .container-form {
    left: 26px;
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem {
    width: 50%;
	height: 460px
} 
.agileui-forms .container-info .info-w3lsitem .w3table-cell {
    padding-right: 0;
    vertical-align: top;
}
.agileui-forms .container-info .info-w3lsitem:nth-child(2) .w3table-cell {
    padding-left: 0; 
}
.main-agileinfo .info-w3lsitem .btn {
    width: 44%;
    font-size: .8em;
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem p {
    font-size: 15px;
    margin: 20px 0 15px;
}
.main-agileinfo .info-w3lsitem .btn {
    width: 40%;
    font-size: .7em;
}
.real-part .container-form ,.container-form{
    left: 35px;
    top: 109px;
    width: 318px;
}
.copyw3-agile p {
    font-size: 0.8em; 
}
}
@media(max-width:414px){
.real-part .container-form, .container-form {
    left: 20px; 
    width: 295px;
}
h1 {
    font-size: 1.8em;
    letter-spacing: 2px;
}
}
@media(max-width:384px){
.main-agileinfo {
    width: 92%; 
}
}
@media(max-width:375px){
.main-agileinfo .agileui-forms .container-info .info-w3lsitem p {
    font-size: 14px; 
}
}
@media(max-width:320px){
.main {
    padding: 1em 0 0;
}
h1 {
    font-size: 1.6em;
    letter-spacing: 1px;
}
.main-agileinfo { 
    margin: 1em auto 4em;
}
.main-agileinfo .agileui-forms .container-info .info-w3lsitem p {
    font-size: 13px;
    margin: 15px 0 10px;
}
.real-part .container-form, .container-form {
    left: 12px;
    width: 255px;
    top: 95px;
}
.w3table-topimg {
    margin-top: -3em;
}
.main-agileinfo label { 
    margin-right: .4em;
}
.main-agileinfo textarea {
    min-height: 4em;
}
.copyw3-agile p { 
    letter-spacing: 0px; 
}
.main-agileinfo { 
    margin: 1em auto 3em;
}
}
/*-- //responsive-design --*/


</style>
